import { createRouter, createWebHashHistory } from 'vue-router';
import Main from '../pages/main/index.vue';

const router = createRouter({
  history: createWebHashHistory(),
  routes: [{
    name: 'main',
    path: '/',
    component: Main,
    redirect: '/recommended',
    children: [
      {
        path: '/recommended',
        component: () => import('../pages/main/pages/recommended/index.vue'),
        redirect: '/recommended/all',
        children: [
          {
            path: 'fe',
            component: () => import('../pages/main/pages/recommended/fe.vue')
          },{
            path: 'be',
            component: () => import('../pages/main/pages/recommended/be.vue')
          },
          {
            path: 'all',
            component: () => import('../pages/main/pages/recommended/all.vue')
          }
        ]
      },
      {
        path: '/pins',
        component: () => import('../pages/main/pages/pins/index.vue')
      }, {
        path:'/post/:id',
        component: () => import('../pages/main/pages/post/index.vue')
      }
    ]
  }]
})

export default router;